module.exports = {

  //修改或新增html-webpack-plugin的值，在index.html里面能读取htmlWebpackPlugin.options.title
  chainWebpack: config => {
    config.plugin('html')
      .tap(args => {
        args[0].title = "盐城市城市监督管理平台";
        return args;
      })
  },

  publicPath: '/slagcar/',

  /* 输出文件目录：在npm run build时，生成文件的目录名称 */
  outputDir: 'slagcar',
  devServer: {
    port: '8080',
    disableHostCheck: true,
    hotOnly: false,
    proxy: {
      '/api': {
        target: 'http://218.206.158.93:8089/infovision/',
        // target: 'http://192.168.0.56:8089/infovision/',
        ws: true, //,
        changeOrigin: true, // 虚拟的站点需要更管origin
        pathRewrite: { //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
          '^/api': ''
        }
      },
      /*'/thirdapi': {
        // target: 'http://192.168.0.56:8081/ebrochure/',
        // target: 'http://192.168.0.214:8081/ebrochure/',
        target:'http://218.206.158.91:8008/',
        ws: true, //,
        changeOrigin: true, // 虚拟的站点需要更管origin
        pathRewrite: { //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
          '^/thirdapi': ''
        }
      },
      '/gaodeapi': {
        target:'https://restapi.amap.com/',
        ws: true, //,
        changeOrigin: true, // 虚拟的站点需要更管origin
        pathRewrite: { //重写路径 比如'/api/aaa/ccc'重写为'/aaa/ccc'
          '^/gaodeapi': ''
        }
      },*/
    },
  },
}
